/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rpg;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 *
 * @author Emmanouil Samatas
 */
public class Battle {

    private int level;
    private boolean isFinal;
    private EnemyFactory ef = EnemyFactory.getInstance();

    public Battle(int level, boolean isFinal) {
        this.level = level;
        this.isFinal = isFinal;
    }

    public List<Enemy> generateEnemies() {
        if (isFinal) {
            return generateBoss();
        }
        return generateSimpleCreeps();

    }

    private List<Enemy> generateBoss() {
        ArrayList<Enemy> boss = new ArrayList<>();
        boss.add(ef.createBoss(level));
        return boss;
    }

    private List<Enemy> generateSimpleCreeps() {
        ArrayList<Enemy> creeps = new ArrayList<>();
        Random generator = new Random();
        int numberOfCreeps = generator.nextInt(GameCoreEngine.MAX_NUMBER_OF_CREEPS) + 1;
        for (int i = 0; i < numberOfCreeps; i++) {
            creeps.add(ef.createEnemy(level));
        }

        return creeps;
    }
    

    
    public static void main(String[] args) {
    }
}
